<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
	</body>
</html>
<script type="text/javascript">
	const list = [
		{username: 'xujie',age:18},
		{username: 'guihui',age:19},
		{username: 'zhouruibing',age:20},
		{username: 'hongyuan',age:21},
	]
	
	for(let key of list.keys()){
		// 获取数组的下标
		console.log(key);
	}
	
	for(let value of list.values()) {
		// 获取数组的成员
		console.log(value);
	}
	console.log('.........');
	// 简洁写法
	for(let value of list){
		console.log(value);
	}
	
	for (let entry of list.entries()){
		// 获取数组每个成员的下标和成员
		console.log(entry);
	}
	
</script>

<script type="text/javascript">
	const friend = [
		{username:'xujie',age:18},
		{username:'guohui',age:18},
		{username:'zhouruibing',age:18},
		{username:'hongyuan',age:18}
	]
	for (let key of friend.keys()){
		console.log(key);
	}
	
	for (let value of friend.values()){
		console.log(value)
	}
	for (let entry of friend.entries()){
		console.log(entry);
	}
</script>
<script type="text/javascript">
	const character = [
		{name:'东方不被',ability:'葵花宝典'},
		{name:'令狐冲',ability:'独孤九剑'},
		{name:'岳不群',ability:'辟邪剑法'},
		{name:'任盈盈',ability:'圣姑'},
		{name:'田不易',ability:'快刀'}
	]
	for (let key of character.keys()){
		console.log(key);
		
	}
	for (let value of character.values()){
		console.log(value);
	}
	for (let entry of character.entries()){
		console.log(entry);
		
	}
</script>
